package com.glela.platform.model.response;

import java.math.BigDecimal;
import java.math.RoundingMode;

import com.glela.platform.model.UserJournal;


public class ResponseBalanceModel {
	private String businessTypeName = "";// 余额类型
	private String type = "";// 类型：+增加，-扣减
	private String amont = "";// 金额
	private String createTime = "";// 创建时间
	private String orderSn = "";// 订单号
	private String click = "";
	
	public ResponseBalanceModel(UserJournal userJournal) {
		this.businessTypeName = userJournal.getComment();
		this.type = userJournal.getType();
		this.amont = userJournal.getType() + BigDecimal.valueOf(userJournal.getMoney()).divide(BigDecimal.valueOf(100)).setScale(2,RoundingMode.HALF_UP).toString();
		this.createTime = userJournal.getCreateTime().length()>16?userJournal.getCreateTime().substring(0,16):userJournal.getCreateTime();
		this.orderSn = userJournal.getOrderSn() == null ? "" : userJournal.getOrderSn();
		this.click = this.getOrderSn().length() > 10 ? "1" : "0";
	}

	public String getBusinessTypeName() {
		return businessTypeName;
	}

	public void setBusinessTypeName(String businessTypeName) {
		this.businessTypeName = businessTypeName;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getAmont() {
		return amont;
	}

	public void setAmont(String amont) {
		this.amont = amont;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getOrderSn() {
		return orderSn;
	}

	public void setOrderSn(String orderSn) {
		this.orderSn = orderSn;
	}

	public String getClick() {
		return click;
	}

	public void setClick(String click) {
		this.click = click;
	}
	
}
